In a Stroop task, participants are presented with a list of words, with each word displayed in a color of ink. The participant’s task is to say out loud the color of the ink in which the word is printed. The task has two conditions: a congruent words condition, and an incongruent words condition. In the congruent words condition, the words being displayed are color words whose names match the colors in which they are printed: for example RED,BLUE. In the incongruent words condition, the words displayed are color words whose names do not match the colors in which they are printed: for example PURPLE, ORANGE. In each case, we measure the time it takes to name the ink colors in equally-sized lists. Each participant will go through and record a time from each condition.
The independent variable here are the two conditions specified for the task, i.e. the congruent words condition and the incongruent words conditions. The dependent variable here is the time it takes for each participant to name the ink color in each list.
$H_{0}$ (null hypothesis) - The null hypothesis is that there is no difference in the average time it takes to name the ink color, between the congruent and incongruent word condition. Which in other words also means that it takes the same amount of time on average to say words which have matching color, as the words whose color doesn't match.
$H_{a}$ (alternative Hypothesis) - There is a difference in the average time it takes to name the ink color between the congruent and incongruent word condition.
$\mu_{c}$: population mean of congruent words
$\mu_{i}$: population mean of incongruent words
Mathematically, this can be expressed as:
\begin{equation} H_0: \mu_c - \mu_i = 0 \end{equation} \begin{equation} H_a:\mu_c - \mu_i \neq 0 \end{equation}
We will perform a two-tailed dependent t-test.
We will use the t-test as opposed to the z test, because we do not know the standard deviation of the population and the sample size is 24, which is < 30.
Reasons for performing two-tailed t-test is to test if the two means are significantly different from each other. It is expected that the mean for the incongruent condition should be higher. But this assumption could be incorrect. Hence as we have specified in our alternate hypothesis we will check for both increase or decrease. We will use the dependent t-test because we are testing repeatedly for the same set of participants under different conditions.
import pandas as pd
ds = pd.read_csv("stroopdata.csv")
Let's take a look at the basic statistics for each group
ds.describe()
As we can see for the congruent group sample mean = 14.05 and std deviation = 3.55. For the incongruent group, sample mean = 22.01 and std dev = 4.79.
import matplotlib.pyplot as plt
%matplotlib inline
ax = ds.plot.box()
ax.set_title('Boxplot of Reaction Time for the two conditions')
ax.set_ylabel("Time in seconds")
As we can see from the boxplot above, the mean reaction time as well as the IQR are longer for Incongruent condition compared to congruent condition which is as expected from the statistics.
N = 24
Degrees of freedom (df) = 23
Hence from the t-table, the critical value for t with $\alpha$ = 0.05,
$t_{critical}$ = $\pm$2.069
S = 4.86 (std dev for the difference)
Hence the SE (standard error):
SE = 4.86/sqrt(24) = 0.99
$\mu_{c}$ - $\mu_{i}$ = 14.05-22.01 = -7.96
The t statistic (t) for this mean is:
t = -7.96/0.99 = -8.04 which indicates a p value < 0.0001
As Tstatistic < Tcritical at alpha = 0.05 which is within the critical region, we reject the null.
Now the margin of error (ME) for 95% Confidence Interval i.e with $\alpha$ = 0.05 can be calculated as:
ME = $t_{critical}$ * SE = 2.069 * 0.99 = 2.04
Hence the 95% confidence interval for average difference in time for congruent and incongruent conditions is {-10.00,-5.91}
This indicates that the participants react in significantly less time for the congruent condition as compared to the incongruent condition. Based on the sample values provided, this is as expected.
The brain apparently processes words faster than it processes colors, and hence in the incongruent condition, there is an extra lag in identifying the color when the text name also reads as a color which causes an interference.
As found from the wiki page there are many similar variations of the Stroop test like Reverse Stroop test or Numerical Stroop test which result in a similar effect.